/**
 * 绑定键盘按键事件
 * @param keyDownName 按键名称
 * @param callback 回调函数
 */
export const bindKeydown = (keyDownName: string, callback: Function) => {
  document.addEventListener('keydown', (event) => {
    keyDownName = keyDownName[0].toUpperCase() + keyDownName.substring(1);
    if (event.key === keyDownName) {
      callback();
    }
  });
};
